home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 3 / CD ACTUAL 3.iso / linux / sonido / mod-0.000 / mod-0 / mod / screen.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-29  |  14.3 KB  |  706 lines

  1. /*
  2.  *  screen.c - Handling of the screen using the ncurses-package.
  3.  *
  4.  *  (C) 1994 Mikael Nordqvist (d91mn@efd.lth.se, mech@df.lth.se)
  5.  */
  6.  
  7. #include <stdio.h>
  8. #include <string.h>
  9. #include <unistd.h>
  10. #include <ncurses.h>
  11.  
  12. #include "mod.h"
  13.  
  14. #define ATTR_LINE      (COLOR_PAIR(7) | A_ALTCHARSET)
  15. #define ATTR_BOLDLINE  (COLOR_PAIR(7) | A_ALTCHARSET | A_BOLD)
  16.  
  17. #define ATTR_FILE      ATTR_LINE
  18. #define ATTR_BOLDFILE  ATTR_BOLDLINE
  19. #define ATTR_DIR       (COLOR_PAIR(2) | A_BOLD)
  20. #define ATTR_BOLDDIR   (COLOR_PAIR(4) | A_BOLD)
  21.  
  22. #define ATTR_REDBAR    (COLOR_PAIR(1) | A_BOLD | A_ALTCHARSET)
  23. #define ATTR_DIMREDBAR (COLOR_PAIR(11) | A_DIM  | A_ALTCHARSET)
  24.  
  25. #define ATTR_PANEL     (COLOR_PAIR(3) | A_BOLD)
  26. #define ATTR_PANELTEXT (COLOR_PAIR(9) | A_BOLD)
  27.  
  28. #define ATTR_PANEL2    (COLOR_PAIR(8) | A_BOLD)
  29.  
  30. #define ATTR_PANELBOX  (COLOR_PAIR(5) | A_BOLD)
  31. #define ATTR_PANELBOXDIM (COLOR_PAIR(10))
  32. #define ATTR_PANELBOX2 (COLOR_PAIR(6) | A_BOLD)
  33.  
  34. WINDOW *swin;
  35.  
  36. int swin_LINES;
  37.  
  38. extern struct mod_info M;
  39. extern struct options opt;
  40. extern int nr_visible_voices;
  41. extern char loaded;
  42.  
  43. extern int nr_songs, nr_files, nr_dirs;
  44.  
  45. inline void wsetcol(WINDOW *w, chtype col)
  46.     wattrset(w, col);
  47. }
  48.  
  49. inline void setcol(chtype col)
  50. {
  51.     attrset(col);
  52. }
  53.  
  54. void init_screen(void)
  55. {
  56.     if(!opt.interactive)
  57.     return;
  58.  
  59.     initscr();
  60.  
  61. #ifdef NCURSES_CHECK_FOR_COLOR
  62.     if(!has_colors())
  63.     error("No colour support on this terminal\n");
  64. #endif
  65.     if(LINES < 19)
  66.     error("You have to have at least 19 lines to run this program.\n");
  67.  
  68.     swin_LINES=MIN(opt.max_lines, LINES-16-2);
  69.     
  70.     swin=newwin(swin_LINES, COLS, 17, 0);
  71.     setup_color_mode();
  72.     cbreak();
  73.     noecho();
  74.     scrollok(stdscr, FALSE);
  75.     leaveok(stdscr, TRUE);
  76.     leaveok(swin, TRUE);
  77.     keypad(stdscr, TRUE);
  78.     curs_set(0); /* Turn the cursor off */
  79. }
  80.  
  81.  
  82. void cleanup_screen(void)
  83. {
  84.     if(!opt.interactive)
  85.     return;
  86.  
  87.     delwin(swin);
  88.     keypad(stdscr, FALSE);
  89.     setcol(COLOR_PAIR(0));
  90.     clear();
  91.     refresh();
  92.     curs_set(1); /* Make cursor visible again */
  93.     endwin();
  94. }
  95.  
  96.  
  97. void draw_screen()
  98. {
  99.     int i;
  100.  
  101.     if(!opt.interactive)
  102.     return;
  103.  
  104.     setcol(ATTR_LINE);
  105.     clear();
  106.     refresh();
  107.     wsetcol(swin, ATTR_LINE);
  108.     wclear(swin);
  109.     wrefresh(swin);
  110.  
  111.     setcol(ATTR_PANEL);
  112.     for(i=0; i < 16; ++i)
  113.     mvaddstr(i, 0, "                                                   "
  114.          "                             ");
  115.  
  116.     mvaddstr(1, 1, "Status                            "
  117.          "Type    MOD  Songpos    /     Speed");
  118.     mvaddstr(2, 1, "                                  "
  119.          "Voices   16  Pattern    /     Tempo");
  120.     mvaddstr(3, 1, "Song                              "
  121.          "Samples  16  Line       /");
  122.     mvaddstr(5, 1, "File                              "
  123.          "Size         Time        :");
  124.  
  125.     refresh();
  126.  
  127.     print_pos(-1,0);
  128.     print_speed(-1,0);
  129.     print_songinfo(-1,0,0,0,0,0);
  130.     print_time(-1);
  131.  
  132.     print_minihelp();
  133.  
  134.     setcol(ATTR_PANEL);
  135.     mvaddstr(7, 2, "# Samplename               Size Volume Looped Tune Bits "
  136.          "Type");
  137.     refresh();
  138.     
  139.     print_songname(" ");
  140.     print_filename(-1);
  141.     print_samples(-1);
  142.  
  143.     print_channelnumbers(0);
  144.     print_status("");
  145.  
  146.     setcol(ATTR_REDBAR);
  147.     mvaddstr(swin_LINES+18-1, 0, "                  Mod version 0.61 - "
  148.          "(C) 1994 Mikael Nordqvist                  ");
  149.     refresh();
  150. }
  151.  
  152.  
  153. void clear_screen(void)
  154. {
  155.     if(!opt.interactive)
  156.     return;
  157.  
  158.     wsetcol(swin, COLOR_PAIR(7));
  159.     werase(swin);
  160.     wrefresh(swin);
  161. }
  162.  
  163.  
  164. void print_channelnumbers(int nr)
  165. {
  166.     char buf[81];
  167.     int i, x, y, delta, actualvoices;
  168.     struct event dummy={0,0,0,0,0,0};
  169.     
  170.     if(!opt.interactive)
  171.     return;
  172.     
  173.     setcol(ATTR_REDBAR);
  174.     if(!loaded) {
  175.     mvprintw(16, 0, fill_string("", 80));
  176.     }
  177.     else {
  178.     delta=print_event(buf, &dummy); /* to find out characters/channel */
  179.     actualvoices=MIN(nr_visible_voices, M.nr_voices);
  180.     mvprintw(16, 0, "  %s %s", (nr ? "<<" : "  "),
  181.          fill_string("", (80-5-4-actualvoices*delta)/2+(delta-2)/2));
  182.     refresh();
  183.     
  184.     for(i=nr; i < nr+actualvoices-1; ++i) {
  185.         if(opt.active_voices & (1<<i))
  186.         setcol(ATTR_REDBAR);
  187.         else
  188.         setcol(ATTR_DIMREDBAR);
  189.         printw("%2d%s", i+1, fill_string("", delta-2));
  190.         refresh();
  191.     }
  192.     if(opt.active_voices & (1<<i))
  193.         setcol(ATTR_REDBAR);
  194.     else
  195.         setcol(ATTR_DIMREDBAR);
  196.     
  197.     getyx(stdscr, y, x);
  198.     printw("%2d%s", i+1, fill_string("", 80-1-2-x-4));
  199.     refresh();
  200.     setcol(ATTR_REDBAR);
  201.     printw("%s  ",    (i < M.nr_voices-1 ? ">>" : "  "));
  202.     }
  203.     refresh();
  204. }
  205.  
  206.  
  207. void print_selectingbar(void)
  208. {
  209.     if(!opt.interactive)
  210.     return;
  211.  
  212.     setcol(ATTR_REDBAR);
  213.     
  214.     mvprintw(16, 0, "   Size  Filename                      "
  215.          "            Directories: %3d Files: %4d ",
  216.          nr_dirs, nr_files-nr_dirs);
  217.     refresh();
  218. }
  219.  
  220.  
  221. void print_songname(char *n)
  222. {
  223.     char noname[]="<no name>";
  224.  
  225.     if(!opt.interactive)
  226.     return;
  227.  
  228.     if(n && !strlen(n))
  229.     n=noname;
  230.     setcol(ATTR_PANELBOX);
  231.     mvaddstr(3, 6, fill_string(n, 27));
  232.     refresh();
  233. }
  234.  
  235.  
  236. void print_filename(int s)
  237. {
  238.     if(!opt.interactive)
  239.     return;
  240.  
  241.     setcol(ATTR_PANELBOX);
  242.     mvaddstr(5, 6, fill_string((s == -1 ? "" : get_modulename(s)), 27));
  243.     refresh();
  244. }
  245.  
  246.  
  247. void print_status(char *s)
  248. {
  249.     if(!opt.interactive)
  250.     return;
  251.  
  252.     setcol(ATTR_PANELBOX);
  253.     mvaddstr(1, 8, fill_string(s ? s : "", 25));
  254.     refresh();
  255. }
  256.  
  257.  
  258. void print_files(int n)
  259. {
  260.     int i, f;
  261.     int oldattr, newattr;
  262.  
  263.     if(!opt.interactive)
  264.     return;
  265.  
  266.     f=n-swin_LINES/2;
  267.     if(!(swin_LINES%2))
  268.     f++;
  269.     
  270.     oldattr=ATTR_FILE;
  271.     wsetcol(swin, oldattr);
  272.     for(i=0; i < swin_LINES; ++i, ++f) {
  273.     if(f < 0 || f >= nr_files) {
  274.         wmove(swin, i, 0);
  275.     }
  276.     else {
  277.         if(f != n) {
  278.         if(is_dir(f))
  279.             newattr=ATTR_DIR;
  280.         else
  281.             newattr=ATTR_FILE;
  282.         }
  283.         else {
  284.         if(is_dir(f))
  285.             newattr=ATTR_BOLDDIR;
  286.         else
  287.             newattr=ATTR_BOLDFILE;
  288.         }
  289.         if(newattr != oldattr) {
  290.         wrefresh(swin);
  291.         wsetcol(swin, newattr);
  292.         oldattr=newattr;
  293.         }
  294.         mvwaddstr(swin, i, 0, get_filestring(f));
  295.     }
  296.     wclrtoeol(swin);
  297.     }
  298.     wrefresh(swin);
  299. }
  300.  
  301.  
  302. void print_samples(int n)
  303. {
  304.     int i;
  305.     struct sample_info *s;
  306. #ifdef FLUSH_INPUT
  307.     char buf[80];
  308. #endif
  309.     
  310.     if(!opt.interactive)
  311.     return;
  312.  
  313.     setcol(ATTR_PANELBOX);
  314.     for(i=0; i < 8; ++i) {
  315.     if(n == -1)
  316.         mvwaddstr(stdscr, 8+i, 1,
  317.               "                                                "
  318.               "               ");
  319.     else {
  320.         s=&M.sample[n];
  321.         if(s->length > 4)
  322.         setcol(ATTR_PANELBOX);
  323.         else
  324.         setcol(ATTR_PANELBOXDIM);
  325.  
  326.         mvwprintw(stdscr, 8+i, 1,
  327.               "%2d %s %6d  %3d    %s   %+2d   %2s  %-6s",
  328.               n, fill_string((M.format == MODFORMAT_ULT ? s->dosname :
  329.                       s->name), 22),
  330.               s->length, s->volume,
  331.               (s->looped ?
  332.                (s->looped == LOOP_BIDIR ? "BIDI" : "Yes ") : "    "),
  333.               s->finetune, (s->bits_16 ? "16" : " 8"),
  334.               s->length > 4 ? "mono" : "unused");
  335.     }
  336.     refresh();
  337.     if(n != -1 && ++n > M.nr_samples)
  338.         n=-1;
  339.     }
  340. #ifdef FLUSH_INPUT
  341.     read(STDIN_FILENO, buf, 80); /* Flush input (for slow CPU's) */
  342. #endif
  343. }
  344.  
  345. char *help_pages[6][9]= {
  346.     {
  347.     "  Welcome!!  ",
  348.     "             ",
  349.     " I hope you  ",
  350.     " will enjoy  ",
  351.     " using mod!  ",
  352.     "             ",
  353.     "F1 and h will",
  354.     "let you flip ",
  355.     " help pages. "
  356.     },
  357.     {
  358.     "   Always:   ",
  359.     "             ",
  360.     " q  Quit     ",
  361.     " h  Help     ",
  362.     " l  Load mode",
  363.     "    on/off   ",
  364.     "+/- Volume   ",
  365.     " m  Mute     ",
  366.     "    on/off   "
  367.     },
  368.     {
  369.     "In load-mode:",
  370.     "             ",
  371.     "n/p Next/prev",
  372.     "    file     ",
  373.     "N/P Next/prev",
  374.     "    file page",
  375.     " u  Parent   ",
  376.     "    directory",
  377.     "ENT Select   "
  378.     },
  379.     {
  380.     " Otherwise:  ",
  381.     "             ",
  382.     "f/b FF/RW    ",
  383.     " r  Restart  ",
  384.     "             ",
  385.     "n/p Next/prev",
  386.         "    song     ",
  387.     "             ",
  388.     "ENT Play/Stop"
  389.     },
  390.     {
  391.     " Otherwise:  ",
  392.     "             ",
  393.     " s  Scrolling",
  394.     "    on/off   ",
  395.     " v  Voice    ",
  396.     "    detail   ",
  397.     "0-9 Toggle   ",
  398.     "    voices   ",
  399.         "    on/off   "
  400.     },
  401.     {
  402.     "  There are  ",
  403.     "  more keys  ",
  404.     "  available. ",
  405.     "(up/down etc)",
  406.     "             ",
  407.         "Read The Fine",
  408.     " Manual for  ",
  409.     "    more     ",
  410.     " information."
  411.     }
  412. };
  413.  
  414. void print_minihelp(void)
  415. {
  416.     static int cur_page=0;
  417.  
  418.     if(!opt.interactive)
  419.     return;
  420.  
  421.     setcol(ATTR_REDBAR);
  422.     move(5, 65);
  423.     vline(ACS_VLINE, 9);
  424.     move(5, 79);
  425.     vline(ACS_VLINE, 9);
  426.  
  427.     move(4, 65);
  428.     addch(ACS_ULCORNER);
  429.     hline(ACS_HLINE, 13);
  430.     move(4, 79);
  431.     addch(ACS_URCORNER);
  432.  
  433.     move(14, 65);
  434.     addch(ACS_LLCORNER);
  435.     hline(ACS_HLINE, 13);
  436.     move(14, 79);
  437.     addch(ACS_LRCORNER);
  438.  
  439.     mvaddstr(5, 66,  help_pages[cur_page][0]);
  440.     mvaddstr(6, 66,  help_pages[cur_page][1]);
  441.     mvaddstr(7, 66,  help_pages[cur_page][2]);
  442.     mvaddstr(8, 66,  help_pages[cur_page][3]);
  443.     mvaddstr(9, 66,  help_pages[cur_page][4]);
  444.     mvaddstr(10, 66, help_pages[cur_page][5]);
  445.     mvaddstr(11, 66, help_pages[cur_page][6]);
  446.     mvaddstr(12, 66, help_pages[cur_page][7]);
  447.     mvaddstr(13, 66, help_pages[cur_page][8]);
  448.     refresh();
  449.     cur_page=(cur_page+1)%6;
  450. }
  451.  
  452. #ifdef DISPLAY_SEQ_IO_Q
  453. #include <sys/ioctl.h>
  454. #include <sys/soundcard.h>
  455.  
  456. extern int seqfd;
  457. #endif
  458.  
  459. void print_pos(int pos, int line)
  460. {
  461.     int i;
  462. #ifdef DISPLAY_SEQ_IO_Q
  463.     int o;
  464.     char buf[80];
  465. #endif
  466.  
  467.     if(!opt.interactive)
  468.     return;
  469.  
  470.     setcol(ATTR_PANELTEXT); 
  471.     if(pos != -1) {
  472.     mvwprintw(stdscr, 1, 56, "%3d", pos);
  473.     mvwprintw(stdscr, 2, 56, "%3d", M.patterntable[pos]);
  474.     mvwprintw(stdscr, 3, 56, "%3d", line);
  475.     }
  476.     else {
  477.     for(i=1; i <= 3; ++i)
  478.         mvwprintw(stdscr, i, 56, "   ");
  479.     }
  480.     refresh();
  481.  
  482. #ifdef DISPLAY_SEQ_IO_Q
  483.     ioctl(seqfd, SNDCTL_SEQ_GETINCOUNT, &i);
  484.     ioctl(seqfd, SNDCTL_SEQ_GETOUTCOUNT, &o);
  485.     sprintf(buf, "I/O: %d/%d", i, 1024-o);
  486.     print_status(buf);
  487. #endif
  488. }
  489.  
  490. void print_speed(int spd, int tempo)
  491. {
  492.     if(!opt.interactive)
  493.     return;
  494.  
  495.     setcol(ATTR_PANELTEXT);
  496.     if(spd != -1) {
  497.     mvwprintw(stdscr, 1, 71, "%3d", spd);
  498.     mvwprintw(stdscr, 2, 71, "%3d", tempo);
  499.     }
  500.     else {
  501.     mvwprintw(stdscr, 1, 71, "   ");
  502.     mvwprintw(stdscr, 2, 71, "   ");
  503.     }
  504.     refresh();
  505. }
  506.  
  507.  
  508. void print_songinfo(int v, int samp, char *type, int sz, int songlen, int pat)
  509. {
  510.     int i;
  511.  
  512.     if(!opt.interactive)
  513.     return;
  514.  
  515.     setcol(ATTR_PANELTEXT);
  516.  
  517.     if(v != -1) {
  518.     mvwprintw(stdscr, 1, 43, "%3s", type);
  519.     mvwprintw(stdscr, 2, 44, "%2d", v);
  520.     mvwprintw(stdscr, 3, 44, "%2d", samp);
  521.     mvwprintw(stdscr, 5, 41, "%4dk", sz/1024);
  522.  
  523.     mvwprintw(stdscr, 1, 60, "%3d", songlen-1);
  524.     mvwprintw(stdscr, 2, 60, "%3d", pat-1);
  525.     mvwprintw(stdscr, 3, 60, " 63");
  526.     }
  527.     else {
  528.     for(i=1; i <= 3; ++i)
  529.         mvwprintw(stdscr, i, 43, "   ");
  530.     mvwprintw(stdscr, 5, 41, "     ");
  531.     for(i=1; i <= 3; ++i)
  532.         mvwprintw(stdscr, i, 60, "   ");
  533.     }
  534.     refresh();
  535. }    
  536.  
  537.  
  538. void print_time(int t)
  539. {
  540.     if(!opt.interactive)
  541.     return;
  542.  
  543.     setcol(ATTR_PANELTEXT);
  544.     if(t != -1) {
  545.     mvwprintw(stdscr, 5, 57, "%3d", t/60);
  546.     mvwprintw(stdscr, 5, 61, "%02d", t%60);
  547.     }
  548.     else {
  549.     mvwprintw(stdscr, 5, 57, "   ");
  550.     mvwprintw(stdscr, 5, 61, "  ");
  551.     }
  552.     refresh();
  553. }
  554.  
  555.  
  556. void clear_all_info(void)
  557. {
  558.     if(!opt.interactive)
  559.     return;
  560.  
  561.     print_samples(-1);
  562.     print_status("");
  563.     print_songname(" ");
  564.     print_filename(-1);
  565.  
  566.     print_pos(-1,0);
  567.     print_speed(-1,0);
  568.     print_songinfo(-1,0,0,0,0,0);
  569.     print_time(-1);
  570. }
  571.  
  572.  
  573. void print_line(int songpos, int line, int voice)
  574. {
  575.     static char tmpbuf[256]={"                                        "
  576.                  "                                        "};
  577.     char *buf;
  578.     int pos, pat, step, v, l, i;
  579.     char midline[81];
  580.     int mid_i=0; /* Remove warning */
  581.  
  582.     if(!opt.interactive)
  583.     return;
  584.  
  585.     scrollok(swin, FALSE);
  586.     wsetcol(swin, ATTR_LINE);
  587.     pat=M.patterntable[songpos];
  588.     
  589.     l=line-swin_LINES/2;
  590.     if(!(swin_LINES%2))
  591.     l++;
  592.     
  593.     buf=&tmpbuf[80];
  594.     for(i=0; i < swin_LINES; ++i, ++l) {
  595.     wmove(swin, i, 0);
  596.     if(l < 0 || l > 63) {
  597.         wclrtoeol(swin);
  598.     }
  599.     else {
  600.         sprintf(buf, "%02d  ", l);
  601.         pos=4;
  602.         for(v=voice; v < M.nr_voices && v < voice+nr_visible_voices; ++v) {
  603.         step=print_event(&buf[pos], GET_EVENT_PTR(v, pat, l));
  604.         pos+=step;
  605.         }
  606.         sprintf(&buf[pos], "|  %02d", l);
  607.         pos+=5;
  608.  
  609.         if(l != line) {
  610.         waddstr(swin, &buf[(pos-80)/2]);
  611.         wclrtoeol(swin);
  612.         }
  613.         else {
  614.         strcpy(midline, &buf[(pos-80)/2]);
  615.         mid_i=i;
  616.         }
  617.     }
  618.     }
  619.     wrefresh(swin);
  620.     wsetcol(swin, ATTR_BOLDLINE);
  621.     wmove(swin, mid_i, 0);
  622.     waddstr(swin, midline);
  623.     wclrtoeol(swin);
  624.     wrefresh(swin);
  625. }
  626.  
  627. extern char *notenames[NR_OCTAVES*12+1];
  628. extern char *effectnames[NR_EFX];
  629. extern char *shorteffectnames[NR_EFX];
  630.  
  631. int print_event(char *buf, struct event *n)
  632. {
  633.     unsigned char note=n->note;
  634.  
  635.     if(note == NOTE_OFF)
  636.     note=12*8+BASE_NOTE; /* Last of the named notes */
  637.     else {
  638.     if(note && M.format != MODFORMAT_S3M)
  639.         note-=2*12;
  640.     }
  641.  
  642.     if(nr_visible_voices == 17) { /* Only notes */
  643.     sprintf(buf, "|%s", 
  644.         (note ? notenames[note-BASE_NOTE] : "   "));
  645.     return 4;
  646.     }
  647.     else if(nr_visible_voices == 9) { /* Notes + instruments */
  648.     sprintf(buf, "|%s ", 
  649.         (note ? notenames[note-BASE_NOTE] : "   "));
  650.     
  651.     if(n->sample)
  652.         sprintf(buf+5, "%2d", n->sample);
  653.     else
  654.         strcpy(buf+5, "  ");
  655.     return 7;
  656.     }
  657.     else { /* All of it (unless there are two effects) */
  658.     sprintf(buf, "| %s ",
  659.         (note ? notenames[note-BASE_NOTE] : "   "));
  660.     
  661.     if(n->sample)
  662.         sprintf(buf+6, "%2d ", n->sample);
  663.     else
  664.         strcpy(buf+6, "   ");
  665.     
  666.     /* Check if there are one or two effects. If there are two we just
  667.      * display the effects without the arguments.
  668.      */
  669.     if(M.format != MODFORMAT_S3M && ((!n->effect && n->arg) || n->effect)
  670.        && ((!n->effect2 && n->arg2) || n->effect2)) {
  671.  
  672.         /* Two effects */
  673.         sprintf(buf+9, "%s+%s ", shorteffectnames[n->effect],
  674.             shorteffectnames[n->effect2]);
  675.     }
  676.     else {
  677.         /* Only one (or no) effect */
  678.         if((!n->effect && n->arg) || n->effect)
  679.         sprintf(buf+9, "%s %02X ", effectnames[n->effect], n->arg);
  680.         else if(!M.format == MODFORMAT_S3M &&
  681.             ((!n->effect2 && n->arg2) || n->effect2))
  682.         sprintf(buf+9, "%s %02X ", effectnames[n->effect2], n->arg2);
  683.         else
  684.         strcpy(buf+9, "        ");
  685.     }
  686.     return 17;
  687.     }
  688. }
  689.  
  690. void setup_color_mode(void)
  691. {
  692.     start_color();
  693.     init_pair(1, COLOR_YELLOW, COLOR_RED);
  694.     init_pair(2, COLOR_BLUE, COLOR_BLACK);
  695.     init_pair(3, COLOR_WHITE, COLOR_CYAN);
  696.     init_pair(4, COLOR_CYAN, COLOR_BLACK);
  697.     init_pair(5, COLOR_YELLOW, COLOR_BLUE);
  698.     init_pair(6, COLOR_YELLOW, COLOR_MAGENTA);
  699.     init_pair(7, COLOR_WHITE, COLOR_BLACK);
  700.     init_pair(8, COLOR_WHITE, COLOR_WHITE);
  701.     init_pair(9, COLOR_BLUE, COLOR_CYAN);
  702.     init_pair(10, COLOR_WHITE, COLOR_BLUE);
  703.     init_pair(11, COLOR_WHITE, COLOR_RED);
  704. }
  705.